#ifndef UDPCLIENT_H
#define UDPCLIENT_H

#include <QObject>
#include <QtNetwork/QUdpSocket>
#include "udpclientthread.h"

class UdpClient : public QObject
{
    Q_OBJECT
public:
    explicit UdpClient(QObject *parent = nullptr, quint16 port = 1234);
    ~UdpClient();

    void start();

    void sendSingleMessage(const QString &message);
    void sendSingleMessage(const QByteArray &message);

    void setIPandPort(QString ip, quint16 port = 1234);

signals:

    void singleMessageSignal(const QByteArray &message);

private:
    quint16 port;
    QString ip;

    UdpClientThread *clientThread;
};

#endif // UDPCLIENT_H
